import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import mainView from '@/views/mainView'
import startView from '@/views/startView'
import twoView from '@/views/twoView'
import thereView from '@/views/thereView'

const routes = [
  {
    path: '/',
    name: 'mainView',
    component: mainView,
    meta: { title: '首页' },
    children: [
      { path: '/', redirect: '/startView' },
      {
        path: '/homeView',
        name: 'home',
        component: HomeView,
        meta: { title: '皮肤' }
      },
      {
        path: '/startView',
        name: 'start',
        component: startView,
        meta: { title: '总览' }
      },
      {
        path: '/twoView',
        name: 'two',
        component: twoView,
        meta: { title: '右键测试' }
      },
      {
        path: '/thereview',
        name: 'thereview',
        component: thereView,
        meta: { title: '功能3' }
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
